<template>
    <div>
       <ul class="mui-table-view">
				<li class="mui-table-view-cell mui-media" v-for="item in newlist" :key="item.id">
					<router-link :to="'/home/newone/'+item.id">                         
						<img class="mui-media-object mui-pull-left" src="http://img1.imgtn.bdimg.com/it/u=1072867052,945582671&fm=26&gp=0.jpg">
						<div class="mui-media-body">
							<h3>{{ item.title }}</h3>
							<p class='mui-ellipsis'>
                                <span>发布时间{{ item.add_time |  solveTime('YYYY-MM-DD')}}</span>
                                <span>点击:{{ item.click }}次</span>
                            </p>
						</div>
					</router-link >
				</li>
             
			</ul>
    </div>
</template>

<script>
import { Toast } from 'mint-ui';
    export default{
        data () {
            return {
                newlist:[]
            }
        },
        created() {
            this.getNew()
        },
        methods:{
                getNew(){
                    this.$http.get('api/getnewslist').then(data=>{
                        if(data.body.status===0){
                             this.newlist=data.body.message
                        }else{
                            Toast('获取新闻列表失败')
                        }
                     
                       
                    })
                }
            }
        }
    
    
</script>

<style lang="less" scoped>
.mui-table-view{
    li{
        h3{
            font-size: 16px;
        }
        p{
            display: flex;
            justify-content: space-between;
            span{
                font-size: 8px;
                color:#2233ff
            }
        }
    }
}
</style>
